#include "processbar.h"
#include  <unistd.h>

typedef void (*callback_t)(int);



void download(callback_t cb)
{
    int request = 1000;
    int curr = 0;

    while(curr <= request)
    {
        cb(curr * 100 / request);

        curr += 10;
        usleep(10000);
    }
    printf("\n");
}

int main()
{
    printf("download1: \n");
    download(processbar);
    initBar();

    printf("download2: \n");
    download(processbar);
    initBar();

    
    printf("download3: \n");
    download(processbar);
    initBar();


    printf("download4: \n");
    download(processbar);
    initBar();

    return 0;
}
